package genetic.q4.functions;

import genetic.TreeNode;
import genetic.q4.TicTacToeBoard;

public class PutMinForOther extends TicTacToeTerminal {

	@Override
	public void play(TicTacToeBoard board, int side) {
		int otherSide = TicTacToeBoard.X + TicTacToeBoard.O - side;
		int rand = board.getMinEmptyPlace();
		if (rand!=-1){
			board.put(otherSide, rand);
		}
	}

	@Override
	public TreeNode clone() {
		return new PutMinForOther();
	}

	@Override
	public boolean equals(Object obj) {
		return obj instanceof PutMinForOther;
	}

	@Override
	public String getName() {
		return "pmfo";
	}

}
